/**
 * Created by ls-PC on 2016/7/26.
 */

var moment = require('moment');
module.exports =function(orm,db){

    var User=db.define('user',{
        usermobile: String,
        userpassword:String,
        name:String,
        male:Boolean,
        age:{ type: 'number',rational : false  },
        bonus:{ type: 'number',rational : false  },    //积分
        status:{ type: 'number',rational : false  },   //1 激活 2黑名单
        email:String,
        address:String,
        usertype:{ type: 'number',rational : false  }, //1.病人 2医生 3 管理员
        image:String,
        signature:String,                                //个人签名
        money:String,                                    //账户信息
        qqopen:String,                                   //qq账号登录
        wxopen:String,                                  //wechat账号登录
        isOnline:{ type: 'number',rational : false  }   //判断是否在线 0 不在线 1 在线

    },{
        methods:{
            serialize: function (){
                return{
                    id:this.id,
                    usermobile: this.usermobile,
                    userpassword:this.userpassword,
                    name:this.name,
                    male:this.male,
                    age:this.age,
                    bonus:this.bonus,
                    status:this.status,
                    email:this.email,
                    address:this.address,
                    usertype:this.usertype,
                    image:this.image,
                    signature:this.signature,
                    money:this.money,
                    qqopen:this.qqopen,
                    wxopen:this.wxopen,
                    isonline:this.isOnline
                }
            }
        }
    })
}